package com.gxuwz.zlc.service.impl;

import com.gxuwz.zlc.entity.Repair;
import com.gxuwz.zlc.mapper.RepairMapper;
import com.gxuwz.zlc.service.RepairService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 维修
 */
@Service
public class RepairServiceImpl implements RepairService {

    @Autowired
    private RepairMapper repairMapper;

    @Override
    public List<Repair> findRepair() {
        return repairMapper.selectList(null);
    }

    @Override
    public Repair findRepairById(Integer repairId) {
        return repairMapper.selectById(repairId);
    }

    @Override
    public void addRepair(Repair repair) {
        repairMapper.insert(repair);
    }

    @Override
    public void updateRepair(Repair repair) {
        repairMapper.updateById(repair);
    }

    @Override
    public void deleteRepair(Integer repairId) {
        repairMapper.deleteById(repairId);
    }

}
